#include "functions.h"

using namespace std;

int main()
{
  int m = 7;
  int n = 3;
  double** A = new double*[m];
  for(int i = 0; i < m; i++)
    A[i] = new double[n]();
  A[0][0] = 1.0;
  A[1][0] = A[6][0] = 0.75*0.75;
  A[2][0] = A[5][0] = 0.25;
  A[4][0] = 0.0625;
  A[0][1] = -1.0;
  A[1][1] = -0.75;
  A[2][1] = -0.5;
  A[4][1] = 0.25;
  A[5][1] = 0.5;
  A[6][1] = 0.75;
  for(int i = 0; i < m; i++)
    A[i][2] = 1.0;
  double* b = new double[m]();
  b[0] = 1.0;
  b[1] = 0.8125;
  b[2] = 0.75;
  b[3] = 1.0;
  b[4] = 1.3125;
  b[5] = 1.75;
  b[6] = 2.3125;

  LS_QR_Householder(A, b, m, n);
  for(int i = 0; i < n; i++)
    cout << "x[" << i << "] = " << b[i] << endl;

  for(int i = 0; i < m; i++)
    delete [] A[i];
  delete [] A;
  return 0;
};
